package opn.srn.event;

import opn.srn.command.ICommand;

public class SimpleEvent implements IEvent {

	ICommand<?> source;
	int type;
	Object data;

	public SimpleEvent(ICommand<?> source, int type, Object data) {
		this.source = source;
		this.type = type;
		this.data = data;
	}

	@Override
	public int getType() {
		return type;
	}

	@SuppressWarnings("unchecked")
	@Override
	public <T> T getData() {
		return (T) data;
	}

	@Override
	public <T> void setData(T data) {
		this.data = data;
	}

}
